<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Presence of Bacteria after Drug Treatments</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for bacteria"><tr><td>bacteria</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>
Presence of Bacteria after Drug Treatments
</h2>

<h3>Description</h3>

<p>Tests of the presence of the bacteria <em>H. influenzae</em>
in children with otitis media in the Northern Territory of Australia.
</p>


<h3>Usage</h3>

<pre>
bacteria
</pre>


<h3>Format</h3>

<p>This data frame has 220 rows and the following columns:
</p>

<dl>
<dt>y</dt><dd><p>presence or absence: a factor with levels
<code>n</code> and <code>y</code>.</p>
</dd>
<dt>ap</dt><dd><p>active/placebo: a factor with levels <code>a</code> and <code>p</code>.</p>
</dd>
<dt>hilo</dt><dd><p>hi/low compliance: a factor with levels <code>hi</code> amd
<code>lo</code>.</p>
</dd>
<dt>week</dt><dd><p>numeric: week of test.</p>
</dd>
<dt>ID</dt><dd><p>subject ID: a factor.</p>
</dd>
<dt>trt</dt><dd><p>a factor with levels <code>placebo</code>, <code>drug</code> and
<code>drug+</code>, a re-coding of <code>ap</code> and <code>hilo</code>.</p>
</dd>
</dl>



<h3>Details</h3>

<p>Dr A. Leach tested the effects of a drug on 50 children with a history of
otitis media in the Northern Territory of Australia.  The children
were randomized to the drug or the a placebo, and also to receive
active encouragement to comply with taking the drug.
</p>
<p>The presence of <em>H. influenzae</em> was checked at weeks 0, 2, 4, 6
and 11: 30 of the checks were missing and are not included in this
data frame.
</p>


<h3>Source</h3>

<p>Dr Amanda Leach <em>via</em> Mr James McBroom.
</p>


<h3>References</h3>

<p>Menzies School of Health Research 1999&ndash;2000 Annual Report. p.20.
<a href="http://www.menzies.edu.au/icms_docs/172302_2000_Annual_report.pdf">http://www.menzies.edu.au/icms_docs/172302_2000_Annual_report.pdf</a>.
</p>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S.</em> Fourth edition.  Springer.
</p>


<h3>Examples</h3>

<pre>
contrasts(bacteria$trt) &lt;- structure(contr.sdif(3),
     dimnames = list(NULL, c("drug", "encourage")))
## fixed effects analyses
summary(glm(y ~ trt * week, binomial, data = bacteria))
summary(glm(y ~ trt + week, binomial, data = bacteria))
summary(glm(y ~ trt + I(week &gt; 2), binomial, data = bacteria))

# conditional random-effects analysis
library(survival)
bacteria$Time &lt;- rep(1, nrow(bacteria))
coxph(Surv(Time, unclass(y)) ~ week + strata(ID),
      data = bacteria, method = "exact")
coxph(Surv(Time, unclass(y)) ~ factor(week) + strata(ID),
      data = bacteria, method = "exact")
coxph(Surv(Time, unclass(y)) ~ I(week &gt; 2) + strata(ID),
      data = bacteria, method = "exact")

# PQL glmm analysis
library(nlme)
summary(glmmPQL(y ~ trt + I(week &gt; 2), random = ~ 1 | ID,
                family = binomial, data = bacteria))
</pre>


</body></html>
